home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 March / macformat-035.iso / CodeWarrior Lite 1.4 / MacOS Support / Headers / Universal Headers / IntlResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-06  |  12.4 KB  |  355 lines  |  [TEXT/CWIE]

  1. /*
  2.      File:        IntlResources.h
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __INTLRESOURCES__
  21. #define __INTLRESOURCES__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41.  
  42. enum {
  43. /* Bits in the itlcFlags byte */
  44.     itlcShowIcon                = 7,                            /*Show icon even if only one script*/
  45.     itlcDualCaret                = 6,                            /*Use dual caret for mixed direction text*/
  46. /* Bits in the itlcSysFlags word */
  47.     itlcSysDirection            = 15,                            /*System direction - left to right/right to left*/
  48.     tokLeftQuote                = 0,
  49.     tokRightQuote                = 1,
  50.     tokLeadPlacer                = 2,
  51.     tokLeader                    = 3,
  52.     tokNonLeader                = 4,
  53.     tokZeroLead                    = 5,
  54.     tokPercent                    = 6,
  55.     tokPlusSign                    = 7,
  56.     tokMinusSign                = 8,
  57.     tokThousands                = 9,
  58.     tokSeparator                = 11,                            /*10 is a reserved field*/
  59.     tokEscape                    = 12,
  60.     tokDecPoint                    = 13,
  61.     tokEPlus                    = 14,
  62.     tokEMinus                    = 15,
  63.     tokMaxSymbols                = 30,
  64.     curNumberPartsVersion        = 1                                /*current version of NumberParts record*/
  65. };
  66.  
  67. enum {
  68.     currSymLead                    = 16,
  69.     currNegSym                    = 32,
  70.     currTrailingZ                = 64,
  71.     currLeadingZ                = 128
  72. };
  73.  
  74. enum {
  75.     mdy,
  76.     dmy,
  77.     ymd,
  78.     myd,
  79.     dym,
  80.     ydm
  81. };
  82.  
  83. typedef SInt8 DateOrders;
  84.  
  85.  
  86. enum {
  87.     timeCycle24                    = 0,                            /*time sequence 0:00 - 23:59*/
  88.     timeCycleZero                = 1,                            /*time sequence 0:00-11:59, 0:00 - 11:59*/
  89.     timeCycle12                    = 255,                            /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
  90.     zeroCycle                    = 1,                            /*old name for timeCycleZero*/
  91.     longDay                        = 0,                            /*day of the month*/
  92.     longWeek                    = 1,                            /*day of the week*/
  93.     longMonth                    = 2,                            /*month of the year*/
  94.     longYear                    = 3,                            /*year*/
  95.     supDay                        = 1,                            /*suppress day of month*/
  96.     supWeek                        = 2,                            /*suppress day of week*/
  97.     supMonth                    = 4,                            /*suppress month*/
  98.     supYear                        = 8,                            /*suppress year*/
  99.     dayLdingZ                    = 32,
  100.     mntLdingZ                    = 64,
  101.     century                        = 128,
  102.     secLeadingZ                    = 32,
  103.     minLeadingZ                    = 64,
  104.     hrLeadingZ                    = 128
  105. };
  106.  
  107. /* move OffsetTable to QuickdrawText */
  108. struct Intl0Rec {
  109.     char                            decimalPt;                    /*decimal point character*/
  110.     char                            thousSep;                    /*thousands separator character*/
  111.     char                            listSep;                    /*list separator character*/
  112.     char                            currSym1;                    /*currency symbol*/
  113.     char                            currSym2;
  114.     char                            currSym3;
  115.     UInt8                            currFmt;                    /*currency format flags*/
  116.     UInt8                            dateOrder;                    /*order of short date elements: mdy, dmy, etc.*/
  117.     UInt8                            shrtDateFmt;                /*format flags for each short date element*/
  118.     char                            dateSep;                    /*date separator character*/
  119.     UInt8                            timeCycle;                    /*specifies time cycle: 0..23, 1..12, or 0..11*/
  120.     UInt8                            timeFmt;                    /*format flags for each time element*/
  121.     char                            mornStr[4];                    /*trailing string for AM if 12-hour cycle*/
  122.     char                            eveStr[4];                    /*trailing string for PM if 12-hour cycle*/
  123.     char                            timeSep;                    /*time separator character*/
  124.     char                            time1Suff;                    /*trailing string for AM if 24-hour cycle*/
  125.     char                            time2Suff;
  126.     char                            time3Suff;
  127.     char                            time4Suff;
  128.     char                            time5Suff;                    /*trailing string for PM if 24-hour cycle*/
  129.     char                            time6Suff;
  130.     char                            time7Suff;
  131.     char                            time8Suff;
  132.     UInt8                            metricSys;                    /*255 if metric, 0 if inches etc.*/
  133.     short                            intl0Vers;                    /*region code (hi byte) and version (lo byte)*/
  134. };
  135. typedef struct Intl0Rec Intl0Rec;
  136.  
  137. typedef Intl0Rec *Intl0Ptr, **Intl0Hndl;
  138.  
  139. struct Intl1Rec {
  140.     Str15                            days[7];                    /*day names*/
  141.     Str15                            months[12];                    /*month names*/
  142.     UInt8                            suppressDay;                /*255 for no day, or flags to suppress any element*/
  143.     UInt8                            lngDateFmt;                    /*order of long date elements*/
  144.     UInt8                            dayLeading0;                /*255 for leading 0 in day number*/
  145.     UInt8                            abbrLen;                    /*length for abbreviating names*/
  146.     char                            st0[4];                        /*separator strings for long date format*/
  147.     char                            st1[4];
  148.     char                            st2[4];
  149.     char                            st3[4];
  150.     char                            st4[4];
  151.     short                            intl1Vers;                    /*region code (hi byte) and version (lo byte)*/
  152.     short                            localRtn[1];                /*now a flag for opt extension*/
  153. };
  154. typedef struct Intl1Rec Intl1Rec;
  155.  
  156. typedef Intl1Rec *Intl1Ptr, **Intl1Hndl;
  157.  
  158. /*fields for optional itl1 extension*/
  159. struct Itl1ExtRec {
  160.     Intl1Rec                        base;                        /*un-extended Intl1Rec*/
  161.     short                            version;
  162.     short                            format;
  163.     short                            calendarCode;                /*calendar code for this itl1 resource*/
  164.     long                            extraDaysTableOffset;        /*offset in itl1 to extra days table*/
  165.     long                            extraDaysTableLength;        /*length of extra days table*/
  166.     long                            extraMonthsTableOffset;        /*offset in itl1 to extra months table*/
  167.     long                            extraMonthsTableLength;        /*length of extra months table*/
  168.     long                            abbrevDaysTableOffset;        /*offset in itl1 to abbrev days table*/
  169.     long                            abbrevDaysTableLength;        /*length of abbrev days table*/
  170.     long                            abbrevMonthsTableOffset;    /*offset in itl1 to abbrev months table*/
  171.     long                            abbrevMonthsTableLength;    /*length of abbrev months table*/
  172.     long                            extraSepsTableOffset;        /*offset in itl1 to extra seps table*/
  173.     long                            extraSepsTableLength;        /*length of extra seps table*/
  174.     short                            tables[1];                    /*now a flag for opt extension*/
  175. };
  176. typedef struct Itl1ExtRec Itl1ExtRec;
  177.  
  178. struct UntokenTable {
  179.     short                            len;
  180.     short                            lastToken;
  181.     short                            index[256];                    /*index table; last = lastToken*/
  182. };
  183. typedef struct UntokenTable UntokenTable;
  184.  
  185. typedef UntokenTable *UntokenTablePtr, **UntokenTableHandle;
  186.  
  187. union WideChar {
  188.     char                            a[2];                        /*0 is the high order character*/
  189.     short                            b;
  190. };
  191. typedef union WideChar WideChar;
  192.  
  193. struct WideCharArr {
  194.     short                            size;
  195.     WideChar                        data[10];
  196. };
  197. typedef struct WideCharArr WideCharArr;
  198.  
  199. struct NumberParts {
  200.     short                            version;
  201.     WideChar                        data[31];                    /*index by [tokLeftQuote..tokMaxSymbols]*/
  202.     WideCharArr                        pePlus;
  203.     WideCharArr                        peMinus;
  204.     WideCharArr                        peMinusPlus;
  205.     WideCharArr                        altNumTable;
  206.     char                            reserved[20];
  207. };
  208. typedef struct NumberParts NumberParts;
  209.  
  210. typedef NumberParts *NumberPartsPtr;
  211.  
  212. struct Itl4Rec {
  213.     short                            flags;                        /*reserved*/
  214.     long                            resourceType;                /*contains 'itl4'*/
  215.     short                            resourceNum;                /*resource ID*/
  216.     short                            version;                    /*version number*/
  217.     long                            resHeader1;                    /*reserved*/
  218.     long                            resHeader2;                    /*reserved*/
  219.     short                            numTables;                    /*number of tables, one-based*/
  220.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  221.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  222.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  223.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  224.     long                            defPartsOffset;                /*offset to default number parts table*/
  225.     long                            resOffset6;                    /*reserved*/
  226.     long                            resOffset7;                    /*reserved*/
  227.     long                            resOffset8;                    /*reserved*/
  228. };
  229. typedef struct Itl4Rec Itl4Rec;
  230.  
  231. typedef Itl4Rec *Itl4Ptr, **Itl4Handle;
  232.  
  233. /* New NItl4Rec for System 7.0: */
  234. struct NItl4Rec {
  235.     short                            flags;                        /*reserved*/
  236.     long                            resourceType;                /*contains 'itl4'*/
  237.     short                            resourceNum;                /*resource ID*/
  238.     short                            version;                    /*version number*/
  239.     short                            format;                        /*format code*/
  240.     short                            resHeader;                    /*reserved*/
  241.     long                            resHeader2;                    /*reserved*/
  242.     short                            numTables;                    /*number of tables, one-based*/
  243.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  244.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  245.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  246.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  247.     long                            defPartsOffset;                /*offset to default number parts table*/
  248.     long                            whtSpListOffset;            /*offset to white space code list*/
  249.     long                            resOffset7;                    /*reserved*/
  250.     long                            resOffset8;                    /*reserved*/
  251.     short                            resLength1;                    /*reserved*/
  252.     short                            resLength2;                    /*reserved*/
  253.     short                            resLength3;                    /*reserved*/
  254.     short                            unTokenLength;                /*length of untoken table*/
  255.     short                            defPartsLength;                /*length of default number parts table*/
  256.     short                            whtSpListLength;            /*length of white space code list*/
  257.     short                            resLength7;                    /*reserved*/
  258.     short                            resLength8;                    /*reserved*/
  259. };
  260. typedef struct NItl4Rec NItl4Rec;
  261.  
  262. typedef NItl4Rec *NItl4Ptr, **NItl4Handle;
  263.  
  264. struct TableDirectoryRecord {
  265.     OSType                            tableSignature;                /*4 byte long table name */
  266.     unsigned long                    reserved;                    /*Reserved for internal use */
  267.     unsigned long                    tableStartOffset;            /*Table start offset in byte*/
  268.     unsigned long                    tableSize;                    /*Table size in byte*/
  269. };
  270. typedef struct TableDirectoryRecord TableDirectoryRecord;
  271.  
  272. struct Itl5Record {
  273.     Fixed                            versionNumber;                /*itl5 resource version number */
  274.     unsigned short                    numberOfTables;                /*Number of tables it contains */
  275.     unsigned short                    reserved[3];                /*Reserved for internal use */
  276.     TableDirectoryRecord            tableDirectory[1];            /*Table directory records */
  277. };
  278. typedef struct Itl5Record Itl5Record;
  279.  
  280. struct RuleBasedTrslRecord {
  281.     short                            sourceType;                    /*Transliterate target type for the LHS of the rule */
  282.     short                            targetType;                    /*Transliterate target type for the RHS of the rule */
  283.     short                            formatNumber;                /*Transliterate resource format number */
  284.     short                            propertyFlag;                /*Transliterate property flags */
  285.     short                            numberOfRules;                /*Number of rules following this field */
  286. };
  287. typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
  288.  
  289. struct ItlcRecord {
  290.     short                            itlcSystem;                    /*default system script*/
  291.     short                            itlcReserved;                /*reserved*/
  292.     SInt8                            itlcFontForce;                /*default font force flag*/
  293.     SInt8                            itlcIntlForce;                /*default intl force flag*/
  294.     SInt8                            itlcOldKybd;                /*MacPlus intl keybd flag*/
  295.     SInt8                            itlcFlags;                    /*general flags*/
  296.     short                            itlcIconOffset;                /*keyboard icon offset; not used in 7.0*/
  297.     SInt8                            itlcIconSide;                /*keyboard icon side; not used in 7.0*/
  298.     SInt8                            itlcIconRsvd;                /*rsvd for other icon info*/
  299.     short                            itlcRegionCode;                /*preferred verXxx code*/
  300.     short                            itlcSysFlags;                /*flags for setting system globals*/
  301.     SInt8                            itlcReserved4[32];            /*for future use*/
  302. };
  303. typedef struct ItlcRecord ItlcRecord;
  304.  
  305. struct ItlbRecord {
  306.     short                            itlbNumber;                    /*itl0 id number*/
  307.     short                            itlbDate;                    /*itl1 id number*/
  308.     short                            itlbSort;                    /*itl2 id number*/
  309.     short                            itlbFlags;                    /*Script flags*/
  310.     short                            itlbToken;                    /*itl4 id number*/
  311.     short                            itlbEncoding;                /*itl5 ID # (optional; char encoding)*/
  312.     short                            itlbLang;                    /*current language for script */
  313.     SInt8                            itlbNumRep;                    /*number representation code*/
  314.     SInt8                            itlbDateRep;                /*date representation code */
  315.     short                            itlbKeys;                    /*KCHR id number*/
  316.     short                            itlbIcon;                    /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
  317. };
  318. typedef struct ItlbRecord ItlbRecord;
  319.  
  320. /* New ItlbExtRecord structure for System 7.0 */
  321. struct ItlbExtRecord {
  322.     ItlbRecord                        base;                        /*un-extended ItlbRecord*/
  323.     long                            itlbLocalSize;                /*size of script's local record*/
  324.     short                            itlbMonoFond;                /*default monospace FOND ID*/
  325.     short                            itlbMonoSize;                /*default monospace font size*/
  326.     short                            itlbPrefFond;                /*preferred FOND ID*/
  327.     short                            itlbPrefSize;                /*preferred font size*/
  328.     short                            itlbSmallFond;                /*default small FOND ID*/
  329.     short                            itlbSmallSize;                /*default small font size*/
  330.     short                            itlbSysFond;                /*default system FOND ID*/
  331.     short                            itlbSysSize;                /*default system font size*/
  332.     short                            itlbAppFond;                /*default application FOND ID*/
  333.     short                            itlbAppSize;                /*default application font size*/
  334.     short                            itlbHelpFond;                /*default Help Mgr FOND ID*/
  335.     short                            itlbHelpSize;                /*default Help Mgr font size*/
  336.     Style                            itlbValidStyles;            /*set of valid styles for script*/
  337.     Style                            itlbAliasStyle;                /*style (set) to mark aliases*/
  338. };
  339. typedef struct ItlbExtRecord ItlbExtRecord;
  340.  
  341.  
  342. #if PRAGMA_IMPORT_SUPPORTED
  343. #pragma import off
  344. #endif
  345.  
  346. #if PRAGMA_ALIGN_SUPPORTED
  347. #pragma options align=reset
  348. #endif
  349.  
  350. #ifdef __cplusplus
  351. }
  352. #endif
  353.  
  354. #endif /* __INTLRESOURCES__ */
  355.